feat(windows): add 'Follow system theme' option for dark mode#10815
feat(windows): add 'Follow system theme' option for dark mode#10815BenJule wants to merge 1 commit into
Conversation
5bf2121 to
770f7d2
Compare
|
Apologies — this PR was closed by mistake on 2026-06-07, and that was an error on my side, not a deliberate decision to withdraw the change. It happened as an unintended side effect of a branch cleanup in my fork: deleting the head branch automatically closed this PR. The contribution still stands. I have restored the branch and reopened the PR. Sorry for the noise and any confusion this caused. |
Rebased onto current master and reduced to the feature's own source changes; removed translation catalogs and unrelated files carried over from the branch base.
770f7d2 to
63a9458
Compare
|
Force-pushed: rebased onto current |
|
Hi @BenJule Can you make this option a combox? |
Summary
Closes #10800.
On macOS, BambuStudio already follows the system dark/light theme automatically via
EVT_SYS_COLOUR_CHANGED. On Windows this event handler was guarded with#ifndef __WINDOWS__, so theme changes were silently ignored and users had to toggle dark mode manually in Preferences.This PR adds a "Follow system theme" checkbox directly below the existing "Enable dark mode" toggle in Preferences → Other. When checked:
WM_SYSCOLORCHANGEand the UI updates automaticallyWhen unchecked, behavior is unchanged — the manual toggle controls dark mode as before.
Implementation
GUI_Utils.hppEVT_SYS_COLOUR_CHANGEDnow callsupdate_dark_config()+on_sys_color_changed()on Windows whendark_mode_follow_system == "1"GUI_App.cppdark_mode()returnscheck_dark_mode()(system appearance) instead of stored config when follow-system is active; on startup, syncs config from system if follow-system is activeMainFrame.cppon_sys_color_changed()callsforce_colors_update()andupdate_ui_from_settings()on all platforms for a full UI refreshPreferences.hpp/.cppm_dark_mode_follow_system_checkbox; "Follow system theme" checkbox with immediate apply + mutual exclusion with manual toggleThe stored config key is
dark_mode_follow_system("0"by default,"1"when enabled) — fully backwards compatible.Test plan